n = eval(input())
cnum = ''
a = 1
s = 0
if n < 10:
  while len(cnum)<n:
    cnum+=str(a)
    a += 1
    s += int(cnum)
    #print(cnum,a,s)
  print(s)
else:
  print('data error!')